<?php

$var = 'Bob';
$Var = 'Joe';
$_4site = 'not yet';
$täyte = 'mansikka';
$bar = &$foo;
$bar = "My name is $bar";
$id = $element->$id_field;
$id = $element->{$id_field};
$id = $element[$id_field];
$var = <<<EOT
My name is "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should print a capital 'A': \x41
EOT;
$var = "He drank some $juice juice.".PHP_EOL;
$var = "He drank some $juices[0] juice.".PHP_EOL;
$var = "He drank some $juices[koolaid1] juice.".PHP_EOL;
$var = "$people->john then said hello to $people->jane.".PHP_EOL;
$var = "{$foo->{$baz[1]}}\n";
$var = $var->{$var->property};
$var = $var->$var->property;
$var = $var->{'😀'};

// http://php.net/manual/ru/migration70.incompatible.php#migration70.incompatible.variable-handling.indirect

$var = $$foo['bar']['baz'];
$var = $foo->$bar['baz'];
$var = $foo->$bar['baz']();
$var = Foo::$bar['baz']();

$var = ${$foo['bar']['baz']};
$var = $foo->{$bar['baz']};
$var = $foo->{$bar['baz']}();
$var = Foo::{$bar['baz']}();

$var = ($$foo)['bar']['baz'];
$var = ($foo->$bar)['baz'];
$var = ($foo->$bar)['baz']();
$var = Foo::$bar()['baz']();

$var = (Foo::$bar())['baz']();
$var = Foo::bar()['baz']();
$var = (Foo::bar())['baz']();

$var = Foo::$bar['baz'];
$var = (Foo::$bar)['baz'];

$$$$$$$$$$var = "I like playing in the park";

$var = ${$a[1]};
$var = ${$a}[1];
$var = ${"name_$type"};
$var = ${ 'price_for_' . $today};
${date("M")} = "Worked";
${$a}[] =  "four" ;
${$base.$suffix} = "whatever";
